//
// Created by 刘洋 on 2024/2/12.
//

#ifndef FOC4_FOC_H
#define FOC4_FOC_H
#include "foc_utils.h"
#include "math.h"
#include "stdlib.h"
#include "tim.h"
#include "AS5600.h"
#include "retarget.h"
typedef enum {
    SinePWM,
    SpaceVectorPWM
}FOCMode;
extern int PP;
extern int DIR;
extern uint8_t foc_modulation;
extern float voltage_power_supply;
void setPhaseVoltage(float Uq, float angle_el);
void setPWM(float Ua,float Ub,float Uc);
void alignSensor(int _PP,int _DIR);
void setVbus(float voltage);
void setFOCMode(FOCMode mode);
#endif //FOC4_FOC_H
